from datetime import datetime
interestRate = 0.002583334

nowMonry = 493056.54

def interestMoney(money):
	return money* interestRate

def getCapitalMoney(money,rePayMent,year,month,sumMoney,yearMoney):
	interest = interestMoney(money)
	capital = rePayMent - interest
	surplus = nowMonry - capital
	print("{}年 {}月 还款{}元 还利息{}元 本金{}元 剩余总额{}元 累计还款{}元 当前年还款{}元".format(year,month,rePayMent,interest,capital,surplus,sumMoney,yearMoney))
	return interest,capital,surplus



now = datetime.now()
year,month = now.year,now.month
year,month = 2023,12


if __name__ == '__main__':
	num = 0
	# rePayMent = 4500

	sumMoney = 0
	yearMoney = 0
	intersetSum = 0
	while True:
		month +=1
		
		if num > 0:
			rePayMent = 2600
		if num % 4 == 0:
			rePayMent = 13500
		
		if month > 12:
			year +=1
			month =  month % 12

		if month == 6:
			rePayMent = 50000
			
		if month == 1:
			yearMoney = 0
		sumMoney += rePayMent

		yearMoney += rePayMent
		interest,capital,nowMonry = getCapitalMoney(money = nowMonry, rePayMent = rePayMent,year = year,month = month,sumMoney = sumMoney,yearMoney = yearMoney)
		num +=1
		intersetSum += interest
		# if interest < 1000:
		# 	break
		if nowMonry < 200000:
			break
		# if year > 2037:
		# 	break
	print("利息共计{}".format(intersetSum))
